﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>zhifu2</title>
</head>

<body>
    <script type="text/javascript">
        //调用微信JS api 支付
        function jsApiCall() {
            var jsons = @Html.Raw(ViewBag.wxJsApiParam);
            WeixinJSBridge.invoke(
            'getBrandWCPayRequest',
             jsons, //josn串
             function (res) {
                 //应该是支付过后或者取消支付 后触发的事件
                 WeixinJSBridge.log(res.err_msg);
                 alert(res.err_code + res.err_desc + res.err_msg);
             }
             );
        }
        function callpay() {
            if (typeof WeixinJSBridge == "undefined") {
                if (document.addEventListener) {
                    document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                }
                else if (document.attachEvent) {
                    document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                }
            }
            else {
                jsApiCall();
            }
        }
        callpay();
    </script>
    <div>
        @*@Html.Raw(ViewBag.result)*@
    </div>
    <div>
        @*<a ID="sub" onclick="callpay()" style="width:210px; height:50px; border-radius: 15px;background-color:#00CD00; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;">立即支付o</a>*@
    </div>
</body>
</html>
